/*
 * XML Type:  PortModel
 * Namespace: http:///org/isistan/flabot/coremodel.ecore
 * Java type: org.isistan.flabot.coremodelEcore.PortModel
 *
 * Automatically generated - do not modify.
 */
package org.isistan.flabot.coremodelEcore.impl;
/**
 * An XML PortModel(@http:///org/isistan/flabot/coremodel.ecore).
 *
 * This is a complex type.
 */
public class PortModelImpl extends org.isistan.flabot.coremodelEcore.impl.NamedElementModelImpl implements org.isistan.flabot.coremodelEcore.PortModel
{
    private static final long serialVersionUID = 1L;
    
    public PortModelImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName PROPERTIES$0 = 
        new javax.xml.namespace.QName("", "properties");
    private static final javax.xml.namespace.QName PROVIDEDS$2 = 
        new javax.xml.namespace.QName("", "provideds");
    private static final javax.xml.namespace.QName REQUIREDS$4 = 
        new javax.xml.namespace.QName("", "requireds");
    private static final javax.xml.namespace.QName COMPONENT$6 = 
        new javax.xml.namespace.QName("", "component");
    private static final javax.xml.namespace.QName COMPONENTS$8 = 
        new javax.xml.namespace.QName("", "components");
    
    
    /**
     * Gets array of all "properties" elements
     */
    public org.isistan.flabot.coremodelEcore.Property[] getPropertiesArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(PROPERTIES$0, targetList);
            org.isistan.flabot.coremodelEcore.Property[] result = new org.isistan.flabot.coremodelEcore.Property[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "properties" element
     */
    public org.isistan.flabot.coremodelEcore.Property getPropertiesArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.coremodelEcore.Property target = null;
            target = (org.isistan.flabot.coremodelEcore.Property)get_store().find_element_user(PROPERTIES$0, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "properties" element
     */
    public int sizeOfPropertiesArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(PROPERTIES$0);
        }
    }
    
    /**
     * Sets array of all "properties" element  WARNING: This method is not atomicaly synchronized.
     */
    public void setPropertiesArray(org.isistan.flabot.coremodelEcore.Property[] propertiesArray)
    {
        check_orphaned();
        arraySetterHelper(propertiesArray, PROPERTIES$0);
    }
    
    /**
     * Sets ith "properties" element
     */
    public void setPropertiesArray(int i, org.isistan.flabot.coremodelEcore.Property properties)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.coremodelEcore.Property target = null;
            target = (org.isistan.flabot.coremodelEcore.Property)get_store().find_element_user(PROPERTIES$0, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(properties);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "properties" element
     */
    public org.isistan.flabot.coremodelEcore.Property insertNewProperties(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.coremodelEcore.Property target = null;
            target = (org.isistan.flabot.coremodelEcore.Property)get_store().insert_element_user(PROPERTIES$0, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "properties" element
     */
    public org.isistan.flabot.coremodelEcore.Property addNewProperties()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.coremodelEcore.Property target = null;
            target = (org.isistan.flabot.coremodelEcore.Property)get_store().add_element_user(PROPERTIES$0);
            return target;
        }
    }
    
    /**
     * Removes the ith "properties" element
     */
    public void removeProperties(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(PROPERTIES$0, i);
        }
    }
    
    /**
     * Gets array of all "provideds" elements
     */
    public org.isistan.flabot.coremodelEcore.InterfaceModel[] getProvidedsArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(PROVIDEDS$2, targetList);
            org.isistan.flabot.coremodelEcore.InterfaceModel[] result = new org.isistan.flabot.coremodelEcore.InterfaceModel[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "provideds" element
     */
    public org.isistan.flabot.coremodelEcore.InterfaceModel getProvidedsArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.coremodelEcore.InterfaceModel target = null;
            target = (org.isistan.flabot.coremodelEcore.InterfaceModel)get_store().find_element_user(PROVIDEDS$2, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "provideds" element
     */
    public int sizeOfProvidedsArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(PROVIDEDS$2);
        }
    }
    
    /**
     * Sets array of all "provideds" element  WARNING: This method is not atomicaly synchronized.
     */
    public void setProvidedsArray(org.isistan.flabot.coremodelEcore.InterfaceModel[] providedsArray)
    {
        check_orphaned();
        arraySetterHelper(providedsArray, PROVIDEDS$2);
    }
    
    /**
     * Sets ith "provideds" element
     */
    public void setProvidedsArray(int i, org.isistan.flabot.coremodelEcore.InterfaceModel provideds)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.coremodelEcore.InterfaceModel target = null;
            target = (org.isistan.flabot.coremodelEcore.InterfaceModel)get_store().find_element_user(PROVIDEDS$2, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(provideds);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "provideds" element
     */
    public org.isistan.flabot.coremodelEcore.InterfaceModel insertNewProvideds(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.coremodelEcore.InterfaceModel target = null;
            target = (org.isistan.flabot.coremodelEcore.InterfaceModel)get_store().insert_element_user(PROVIDEDS$2, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "provideds" element
     */
    public org.isistan.flabot.coremodelEcore.InterfaceModel addNewProvideds()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.coremodelEcore.InterfaceModel target = null;
            target = (org.isistan.flabot.coremodelEcore.InterfaceModel)get_store().add_element_user(PROVIDEDS$2);
            return target;
        }
    }
    
    /**
     * Removes the ith "provideds" element
     */
    public void removeProvideds(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(PROVIDEDS$2, i);
        }
    }
    
    /**
     * Gets array of all "requireds" elements
     */
    public org.isistan.flabot.coremodelEcore.InterfaceModel[] getRequiredsArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(REQUIREDS$4, targetList);
            org.isistan.flabot.coremodelEcore.InterfaceModel[] result = new org.isistan.flabot.coremodelEcore.InterfaceModel[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "requireds" element
     */
    public org.isistan.flabot.coremodelEcore.InterfaceModel getRequiredsArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.coremodelEcore.InterfaceModel target = null;
            target = (org.isistan.flabot.coremodelEcore.InterfaceModel)get_store().find_element_user(REQUIREDS$4, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "requireds" element
     */
    public int sizeOfRequiredsArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(REQUIREDS$4);
        }
    }
    
    /**
     * Sets array of all "requireds" element  WARNING: This method is not atomicaly synchronized.
     */
    public void setRequiredsArray(org.isistan.flabot.coremodelEcore.InterfaceModel[] requiredsArray)
    {
        check_orphaned();
        arraySetterHelper(requiredsArray, REQUIREDS$4);
    }
    
    /**
     * Sets ith "requireds" element
     */
    public void setRequiredsArray(int i, org.isistan.flabot.coremodelEcore.InterfaceModel requireds)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.coremodelEcore.InterfaceModel target = null;
            target = (org.isistan.flabot.coremodelEcore.InterfaceModel)get_store().find_element_user(REQUIREDS$4, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(requireds);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "requireds" element
     */
    public org.isistan.flabot.coremodelEcore.InterfaceModel insertNewRequireds(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.coremodelEcore.InterfaceModel target = null;
            target = (org.isistan.flabot.coremodelEcore.InterfaceModel)get_store().insert_element_user(REQUIREDS$4, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "requireds" element
     */
    public org.isistan.flabot.coremodelEcore.InterfaceModel addNewRequireds()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.coremodelEcore.InterfaceModel target = null;
            target = (org.isistan.flabot.coremodelEcore.InterfaceModel)get_store().add_element_user(REQUIREDS$4);
            return target;
        }
    }
    
    /**
     * Removes the ith "requireds" element
     */
    public void removeRequireds(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(REQUIREDS$4, i);
        }
    }
    
    /**
     * Gets array of all "component" elements
     */
    public org.isistan.flabot.coremodelEcore.ComponentModel[] getComponentArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(COMPONENT$6, targetList);
            org.isistan.flabot.coremodelEcore.ComponentModel[] result = new org.isistan.flabot.coremodelEcore.ComponentModel[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "component" element
     */
    public org.isistan.flabot.coremodelEcore.ComponentModel getComponentArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.coremodelEcore.ComponentModel target = null;
            target = (org.isistan.flabot.coremodelEcore.ComponentModel)get_store().find_element_user(COMPONENT$6, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "component" element
     */
    public int sizeOfComponentArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(COMPONENT$6);
        }
    }
    
    /**
     * Sets array of all "component" element  WARNING: This method is not atomicaly synchronized.
     */
    public void setComponentArray(org.isistan.flabot.coremodelEcore.ComponentModel[] componentArray)
    {
        check_orphaned();
        arraySetterHelper(componentArray, COMPONENT$6);
    }
    
    /**
     * Sets ith "component" element
     */
    public void setComponentArray(int i, org.isistan.flabot.coremodelEcore.ComponentModel component)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.coremodelEcore.ComponentModel target = null;
            target = (org.isistan.flabot.coremodelEcore.ComponentModel)get_store().find_element_user(COMPONENT$6, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(component);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "component" element
     */
    public org.isistan.flabot.coremodelEcore.ComponentModel insertNewComponent(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.coremodelEcore.ComponentModel target = null;
            target = (org.isistan.flabot.coremodelEcore.ComponentModel)get_store().insert_element_user(COMPONENT$6, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "component" element
     */
    public org.isistan.flabot.coremodelEcore.ComponentModel addNewComponent()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.coremodelEcore.ComponentModel target = null;
            target = (org.isistan.flabot.coremodelEcore.ComponentModel)get_store().add_element_user(COMPONENT$6);
            return target;
        }
    }
    
    /**
     * Removes the ith "component" element
     */
    public void removeComponent(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(COMPONENT$6, i);
        }
    }
    
    /**
     * Gets the "components" attribute
     */
    public java.lang.String getComponents()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(COMPONENTS$8);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "components" attribute
     */
    public org.apache.xmlbeans.XmlString xgetComponents()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(COMPONENTS$8);
            return target;
        }
    }
    
    /**
     * True if has "components" attribute
     */
    public boolean isSetComponents()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().find_attribute_user(COMPONENTS$8) != null;
        }
    }
    
    /**
     * Sets the "components" attribute
     */
    public void setComponents(java.lang.String components)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(COMPONENTS$8);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(COMPONENTS$8);
            }
            target.setStringValue(components);
        }
    }
    
    /**
     * Sets (as xml) the "components" attribute
     */
    public void xsetComponents(org.apache.xmlbeans.XmlString components)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(COMPONENTS$8);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlString)get_store().add_attribute_user(COMPONENTS$8);
            }
            target.set(components);
        }
    }
    
    /**
     * Unsets the "components" attribute
     */
    public void unsetComponents()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_attribute(COMPONENTS$8);
        }
    }
}
